<?php
namespace Api\Provider\Admin;

use Api\Provider\IndexProvider;
use Api\Service\ShareService;

/**
 * 分享接口
 * @author Administrator
 *
 */
class ShareProvider extends IndexProvider {

    /**
     * 打开他人分享事件记录
     * @param unknown $param
     */
    public function open($param){
        $service = new ShareService();
        try{
            $service->validateParam($param);
        } catch(\Exception $e) {
            $this->fail(600, null, $e->getMessage());
        }
        
        $id = $service->save($param);
        if($id) {
            $this->success("记录成功");
        } else {
            $this->fail(500);
        }
        
    }
}

